# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=totem-pl-parser
pkgver=3.26.6
pkgrel=3
pkgdesc="GNOME playlist parser library"
url="https://www.gnome.org/"
arch="all !s390x" # gnome-desktop
license="LGPL-2.0-or-later"
makedepends="meson gnome-desktop-dev libxml2-dev json-glib-dev
	gmime-dev libxml2-utils libxslt itstool libarchive-dev libgcrypt-dev"
options="!check" # doesn't detect gvfs' http support
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.gnome.org/sources/totem-pl-parser/${pkgver%.*}/totem-pl-parser-$pkgver.tar.xz"

prepare() {
	default_prepare
	# Patch out -Werror= cflags
	sed "/'-Werror=/d" -i meson.build
}

build() {
	export CFLAGS="$CFLAGS -Wno-error"
	abuild-meson \
		-Denable-libarchive=yes \
		-Denable-libgcrypt=yes \
		-Dintrospection=true \
		build
	meson compile -C build
}

check() {
	meson test --no-rebuild --print-errorlogs -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
1a7aa69e147b55c3c9761328604821a7e40bac4e7b82492e5ce1b2405e3b6d5154e3b06687f2446ec923b34bf6ea96eef179ef8410c005a061d448fc6b3e754e  totem-pl-parser-3.26.6.tar.xz
"
